package com.bootdo.system.dao;

import com.bootdo.system.domain.ItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * 检查项目 Mapper
 *
 * @author zhouxm
 */
@Mapper
public interface ItemDao {
	/**
	 * 根据主键获取
	 * @param itemId 主键
	 * @return
	 * @throws Exception 异常
	 */
    ItemDO get(Long itemId) throws Exception;

	/**
	 * 获取项目列表
	 * @param map
	 * @return
	 * @throws Exception 异常
	 */
    List<ItemDO> list(Map<String, Object> map);

	/**
	 * 获取项目数量
	 * @param map
	 * @return
	 * @throws Exception 异常
	 */
    int count(Map<String, Object> map) throws Exception;

	/**
	 * 保存
	 * @param item
	 * @return
	 * @throws Exception 异常
	 */
    int save(ItemDO item) throws Exception;

	/**
	 * 修改
	 * @param item
	 * @return
	 * @throws Exception 异常
	 */
    int update(ItemDO item) throws Exception;

	/**
	 * 删除
	 * @param itemId
	 * @return
	 * @throws Exception 异常
	 */
    int remove(Long itemId) throws Exception;

	/**
	 * 批量删除
	 * @param itemIds
	 * @return
	 * @throws Exception 异常
	 */
    int batchRemove(Long[] itemIds) throws Exception;

	/**
	 * 获取父级item
	 * @return
	 * @throws Exception
	 */
     Long[] listParentItem() throws Exception;

	/**
	 * 获取item下的用户
	 * @param itemId
	 * @return
	 * @throws Exception 异常
	 */
    int getItemUserNumber(Long itemId) throws Exception;
}
